@extends('backend::common.common_right')
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <div class=" row m-b-sm m-t-sm">
                            <div class="col-md-6">
                                <form method="get" action="{{url('backend/order')}}">
                                    <div class="layui-input-inline">
                                        <label>日期范围</label>
                                        <input type="text" name="date" autocomplete="off" value="{{$date or ''}}" class="layui-input" id="renderdate" placeholder=" - " lay-key="7">
                                    </div>
                                    <span class="checkbox col-md-2 m-r-xs" style="margin: 0px;padding: 0px">
                                        <select class="form-control catsshow" id="seach">
                                            <option value="name">用户名</option>
                                            <option value="mobile">手机号</option>

                                        </select>
                                    </span>
                                    <div class="input-group">
                                        <input type="text" id="seachname" placeholder="搜索内容" name="name"
                                               class="form-control">
                                        <span class="input-group-btn">
                                     <button type="submit" class="btn  btn-primary"> 搜索</button>
                                     </span>
                                    </div>
                                </form>
                                <div class="btn-group col-md-10">
                                    <a class="btn btn-primary" href="{{url('backend/border')}}"
                                       aria-pressed="true">全部</a>
                                    <a class="btn btn-primary" href="{{url('backend/border')}}?paytype=0"
                                       aria-pressed="true">充值</a>
                                    <a class="btn btn-primary" href="{{url('backend/border')}}?paytype=1"
                                       aria-pressed="true">扣费</a>
                                    <span style="float: right">
                                         <a class="btn btn-warning"  href="{{url('backend/bordercreate',['paytype'=>1])}}" >充值</a>
                                         <a class="btn btn-warning" href="{{url('backend/bordercreate',['paytype'=>0])}}" >扣费</a>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover " id="editable">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>充值用户</th>
                                <th>手机号</th>
                                <th>交易币</th>
                                <th>VIP</th>
                                <th>操作时间</th>
                                <th>操作人</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($borders as $order)
                                <tr class="gradeX">
                                    <td>{{$order->id}}</td>
                                    <td><a href="{{url('backend/userinfo',['id'=>$order->user_id])}}"
                                           class="text-navy">{{$order->user->name}}</a></td>
                                    <td>{{$order->user->mobile}}</td>
                                    <td class="center">
                                        {{$order->coins}}
                                    </td>
                                    <td>
                                        {{$order->vip}}
                                    </td>
                                    <td class="center">{{$order->created_at}}</td>
                                    <td class="center">{{$order->admin->name}}</a>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        {{$borders->links()}}
                    </div>
                </div>
            </div>
        </div>
        <script>
            $('#seach').change(function () {
                var seachname = $(this).children('option:selected').val()
                $("#seachname").attr('name', seachname);
            })
            var del = function (id, type) {
                layer.confirm('禁用此用户(不可恢复)？', {
                    btn: ['确定', '取消'] //按钮
                }, function () {
                    window.location.href = "{{url('backend/modeldel')}}/" + type + '/' + id;
                }, function () {

                });
            }
        </script>

@endsection

